<!DOCTYPE html>
<html lang="en">
<head>
    <title>应收0级报表</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link href="/dist/plugins/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"/>
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=4a6c1b54">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <style>
        .moduleName {
            float: left;
            height: 27px;
            line-height: 27px;
            font-size: 22px;
            width: 100px;
            text-align: center;
        }

        .tryStyle {
            width: 30px;
            height: 14px;
            line-height: 14px;
            font-size: 12px;
            /* top: 0; */
            right: 0;
            position: absolute;
            border-radius: 5px;
            margin-top: 1px;
            background: red;
            color: #fff;
            margin-right: -2px;
            transform: scale(0.8);
        }

        .nav-tabs-custom {
            padding: 10px;
            margin-bottom: 0;
            box-shadow: none;
            position: relative;
            overflow: hidden;
        }

        .infoReport {
            display: flex;
            justify-content: flex-start;
            text-align: left;
            margin-left: 10px;
        }

        .infoReport div {
            margin: 0 10px;
        }

        .lineOne {
            text-align: left;
        }

        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        .lineOneNoMore {
            text-align: left;
        }

        .lineOneNoMore span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        .mScrollBox {
            float: left;
            position: relative;
        }

        .imgStyle {
            width: 300px;
            height: 400px;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .templateStyle {
            border: 1px solid #ddd;
            margin-bottom: 10px;
            padding-bottom: 10px;
        }

        .table > thead > tr > th {
            padding: 0;
        }

        .table > tbody > tr > td {
            position: relative;
        }
        table{
            margin-bottom: 0 !important;
        }
    </style>
</head>
<body>
<section class="content" id="app" v-cloak>
    <div class="div-td-content-more"><i></i></div>
        <div class="nav-tabs-custom oaReportNav"><div class="moduleName" style="width: 124px;">应收0级报表</div> <ul class="nav nav-tabs pull-right" style="margin-bottom: 10px;"></ul></div>
        <div style="padding: 0px 10px; background: rgb(255, 255, 255);">
            <!--集团-->
            <table class="table table-bordered text-center table-width"
                   style="width: 650px;">
                <thead>
                <tr>
                    <th rowspan="2" style="width:120px; ">公司名称</th>
                    <th colspan="2" style="width: 200px;">首付款)</th>
                    <th colspan="2" style="width: 200px;">融资款</th>
                    <th rowspan="2" style="width:100px; ">应收总金额(元)</th>
                    <th rowspan="2" style="width: 100px;">逾期总金额(元)</th>
                </tr>
                <tr>
                    <th style="width: 100px;">总应收(元)</th>
                    <th style="width: 100px;">逾期金额(元)</th>
                    <th style="width: 100px;">总应收(元)</th>
                    <th style="width: 100px;">逾期金额(元)</th>
                </tr>
                </thead>
                <tbody>
                <tr v-for="(item,i) in list">
                    <td :rowspan="item.companyNamespan" :class="{hidden: item.companyNamedis}">
                        {{item.companyName}}
                    </td>
                    <td>
                        {{item.firstPayMent==0?'-':item.firstPayMent}}
                    </td>
                    <td >-</td>
                    <td>
                        {{item.financingAmount==0?'-':item.financingAmount}}
                    </td>
                    <td>-</td>
                    <!--人员配置-->
                    <td>
                        {{Number(item.firstPayMent)+Number(item.financingAmount) ==0?'-':
                        Number(item.firstPayMent)+Number(item.financingAmount)}}
                    </td>
                    <td>
                        -
                    </td>

                </tr>
                <tr>
                    <td>合计</td>
                    <td>{{all.firstPayMentTotal==0?'-':all.firstPayMentTotal}}</td>
                    <td>-</td>
                    <td>{{all.financingAmountTotal==0?'-':all.financingAmountTotal}}</td>
                    <td>-</td>
                    <td>{{Number(all.firstPayMentTotal)+Number(all.financingAmountTotal) ==0?'-':
                        Number(all.firstPayMentTotal)+Number(all.financingAmountTotal)}}</td>
                    <td>-</td>
                </tr>
                </tbody>
            </table>
        </div>
</section>
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=8e743a31"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=54c6b89c"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<!--ztree组件所需js-->
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.exhide-3.5.js"></script>
<script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data: {
            back: false,
            isGroup: true,
            a: [],
            thisMonth: new Date().Format("yyyy-MM"),
            day: new Date().Format("yyyy-MM-dd"),//今天
            list: [],

            selectParameter: {
                companyId: "",
                day: new Date().Format("yyyy-MM-dd")//今天
            },
            all:{}
        },
        methods: {
            //获取合计
            getCount: function (arr, key, type) {
                var number = 0;
                for (var i = arr.length - 1; i >= 0; i--) {
                    if (!arr[i].changeColor) {
                        number += Number(arr[i][key] && arr[i][key] != '-' ? arr[i][key] : 0);
                    }

                }
                return number;
            },
            getCount: function (arr, key) {
                var number = 0;
                for (var i = arr.length - 1; i >= 0; i--) {
                    number += (arr[i][key] && arr[i][key] != '-' ? arr[i][key] : 0)

                }
                return number;
            },
            //合并单元格
            tablesMergeCell: function (list) {
                for (field in list[0]) {
                    var k = 0;
                    while (k < list.length) {
                        list[k][field + 'span'] = 1;
                        list[k][field + 'dis'] = false;
                        for (var i = k + 1; i <= list.length - 1; i++) {
                            if (list[k][field] == list[i][field] && list[k][field] != '') {
                                list[k][field + 'span']++;
                                list[k][field + 'dis'] = false;
                                list[i][field + 'span'] = 1;
                                list[i][field + 'dis'] = true;
                            } else {
                                break;
                            }
                        }
                        k = i;
                    }
                }
                return list;
            },
            //初始化时间控件
            showDatePicker: function (e, type) {
                var that = this;
                WdatePicker({
                    onpicked: function (dp) {
                        that.selectParameter.day = dp.cal.getNewDateStr();
                        return true;
                    },
                    maxDate: new Date().Format("yyyy-MM-dd")//今天
                });
                $(e.target).blur();
            },
            getList: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.warNewspaper.receivable.selectReceivable, {}, function (data) {
                    console.log(data)
                    that.list=data;
                    that.all.firstPayMentTotal = that.getCount(that.list, "firstPayMent");
                    that.all.financingAmountTotal = that.getCount(that.list, "financingAmount");

                    //firstPayMent
                });
            }
        },

        mounted: function () {
            var that = this;
            that.getList();
        }
    });

</script>
</body>